<?php
/**
 * Member_model.php
 *
 * $Id:$
 */
 
class Member_model extends CI_Model
{
	function __construct()
	{
		parent::__construct();
		$this->load->database();
	}
	
	function get_map_by_project($project_id)
	{
		$list = $this->db
			->from('member')
			->join('project_member', 'member.id=project_member.m_id')
			->where('project_member.p_id', $project_id)
			->get()
			->result_array();
		
		if($list == NULL)
		{
			return NULL;
		}
		
		$map = array();
		foreach($list as $member)
		{
			$map[$member['id']] = $member;
		}
		
		return $map;
	}
	
}

/* End file of Member_model.php */
/* Location: Member_model.php */